<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html">



<h:head>
	<title>Administrator</title>
	<h:outputScript library="js" name="Script.js" />
	<script src="http://code.jquery.com/jquery-latest.min.js"></script>

</h:head>


<h:body style="background-color:#E0FFFF;">
<h:form>
	<div align="right">
      <h:commandButton value="Logout" action="#{administratorBean.logout}"></h:commandButton>    
</div>
		
		<h2 align="center" style="font-family: Comic Sans MS; color: #00006E;">Bine ai venit, #{loginBean.username}!</h2>

		<br />
		<br />
		<h3 style="font-family: Georgia; background-color: #00006E; color: white; font-size: 23">Chestionare</h3>


		<h:dataTable
		
			 value="#{administratorBean.chestionare}" var="chestionar"
    	
    			styleClass="order-table"
    			headerClass="order-table-header"
    			rowClasses="order-table-odd-row,order-table-even-row">
			
			<h:column >
                #{chestionar.nume}
			</h:column>	
			<h:column>
			
			<h:commandLink value="Edit"
					action="#{administratorBean.edit}">
					<f:param name="chestionarSelected" value="#{chestionar.id}" />
				</h:commandLink>
			</h:column>
				
			<h:column>
			<h:commandLink action="#{administratorBean.delete}">
					<f:param name="chestionarSelected" value="#{chestionar.id}" />
					<h:graphicImage value="x_button.png" style="height: 26px; width: 26px" />
					
				</h:commandLink>
			</h:column>
			<h:column>

			<h:commandLink value="Rezultate"
				action="#{administratorBean.getRezultate}">
				<f:param name="rezultatePressed" value="#{chestionar.id}"/>
				
			</h:commandLink>

			</h:column>
		</h:dataTable>


		<br />
		<br />
		<br />
		<h:commandButton value="Adauga chestionar" style=" font-family:Georgia; font-size:120%; height: 56px; width: 256px" align="top" action="#{administratorBean.addChestionar}"></h:commandButton>
	</h:form>
</h:body>
</html>